namespace WebMVC.Services
{
    using System.Net.Http;
    using System.Threading.Tasks;
    using Microsoft.Extensions.Logging;

    public class ConditionService : IConditionService
    {
        private readonly HttpClient ApiClient;
        private readonly ILogger<ConditionService> Logger;

        public ConditionService(HttpClient httpClient, ILogger<ConditionService> logger)
        {
            ApiClient = httpClient;
            Logger = logger;

        }
        public async Task<string> GetCondition()
        {
            var uri = @"https://localhost:44300/api/checkcondition";
            var response = await ApiClient.GetAsync(uri).ConfigureAwait(true);
            var responseString = await response.Content.ReadAsStringAsync().ConfigureAwait(true);
            return responseString;
        }
    }
}
